package WWW.SST.LIB;

/** 
 CnCard ��ժҪ˵����
*/
public class CnCard
{
	public CnCard()
	{
		//
		// TODO: �ڴ˴���ӹ��캯���߼�
		//
	}



	public static String GetGotoUrl(String moneyx)
	{

		String oid = MOLE.comm.getRandom();
		int uid = MOLE.GetValue.GetCookieInt("hy_num");
		String uname = MOLE.GetValue.GetCookieValue("hy_name");
		double money = Math.abs(Double.parseDouble(moneyx.trim()));
		String myid = ConfigurationSettings.AppSettings["CaiP_netbank_mid"].toString().trim();
		String key = ConfigurationSettings.AppSettings["CaiP_netbank_md5key"].toString().trim();
		String returnUrl = ConfigurationSettings.AppSettings["CaiP_netbank_url"].toString().trim();
		String ymd = java.time.LocalDateTime.now().toString("yyyyMMdd");

		String md5str = FormsAuthentication.HashPasswordForStoringInConfigFileuniquetempvar.trim().toLowerCase();

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region  rwku



		String sql = "select * from bank_charge where oid=" + oid.trim();
		DataTable d = MOLE.SQL.GetDataTable(sql);
		if (d.Rows.size() > 0)
		{
			oid = (Long.parseLong(oid) + Long.parseLong(MOLE.comm.getRandom(2))).toString();
		}

		MOLE.SQLOS o = new MOLE.SQLOS("Bank_Charge");
		o.RS("oid", oid);
		o.RS("hy_num", uid);
		o.RS("hy_name", uname);
		o.RS("amount", money);
		o.RS("success", 0);
		o.Insert();



		// 			string 	sql = "Insert Into Bank_Charge(oid,hy_num,hy_name,amount,success) "
		//				+" values(@oid,@hy_num,@hy_name,@amount,@success)";
		//			SqlConnection conn=new SqlConnection(MOLE.SQL.connectionString);
		//			SqlCommand commandBySql = new SqlCommand(sql,conn);
		//			commandBySql.Parameters.Add("@oid", SqlDbType.VarChar, 0x40).Value = oid;
		//			commandBySql.Parameters.Add("@hy_num", SqlDbType.Int).Value = uid;
		//			commandBySql.Parameters.Add("@hy_name", SqlDbType.VarChar, 0x18).Value = uname;
		//			commandBySql.Parameters.Add("@amount", SqlDbType.Money).Value = 9;
		//			commandBySql.Parameters.Add("@success", SqlDbType.VarChar).Value = "0";
		//			commandBySql.Connection.Open();
		//			int num3 = commandBySql.ExecuteNonQuery();
		//			commandBySql.Connection.Close();
		//			commandBySql.Connection.Dispose();
		//			commandBySql.Dispose();
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#endregion


		String gotourl = "https://www.cncard.net/cnpayment/pay/getorder.aspx?" + "c_mid=" + myid + "&c_order=" + oid + "&c_name=" + uname + "&c_address=" + "&c_tel=" + "&c_post=" + "&c_orderamount=" + String.format("%0.2f", money) + "&c_ymd=" + ymd + "&c_moneytype=0" + "&c_retflag=1" + "&c_returl=" + returnUrl + "&c_signstr=" + md5str + "&c_memo1=" + "&c_memo2=" + "&c_paygate=" + "&c_email=" + "&notifytype=" + "&demostatus=" + "&c_language=" + "&c_version=" + "&c_paymenttype=" + "";
		return (gotourl);
		//return;
	}
}